home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!usenet
- From: Ross Forder <erosco@werple.mira.net.au>
- Newsgroups: comp.lang.c++
- Subject: Two way communication between objects
- Date: Sun, 28 Jan 1996 11:09:54 +1000
- Organization: Werple Internet, Melbourne
- Message-ID: <310ACCE2.2600@werple.mira.net.au>
- NNTP-Posting-Host: dp-m-a19.werple.mira.net.au
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b3 (Win95; I)
-
- I have to apologise what what is probably a stupid question but I'm only
- a beginner at some of this stuff.
-
- I am trying to write a VERY simple client and server set of objects. I
- would like to client to register with the server at ctor time and have
- the server know about the client by saving a pointer to the client
- so he can callback to a method called say 'event'.
-
- The problem is the fact that they will both need a pointer to each other
- and this seems impossible using strong typing. Is there a simple 'object
- oriented' way to do this?
-
- I have been able to make this work by having the server only know about
- a parent class of the client (say eventhandler) but this is still not a
- bulletproof solution.
-
- Can someone set me straight?
-
- Thanks
- Ross Forder
-